package dk.mirasola.systemtraining.bridgewidgets.client.ui.editor;


import com.google.gwt.editor.client.LeafValueEditor;
import dk.mirasola.systemtraining.bridgewidgets.shared.model.distributionfiltertree.HcpInterval;

public class HcpIntervalEditor extends IntervalEditor implements LeafValueEditor<HcpInterval> {

    @Override
    protected int getIntervalMax() {
        return HcpInterval.HCP_INTERVAL_MAX;
    }

    @Override
    protected int getIntervalMin() {
        return HcpInterval.HCP_INTERVAL_MIN;
    }

    @Override
    public void setValue(HcpInterval value) {
        setValidMax(value.getMaxHcp());
        setValidMin(value.getMinHcp());
    }

    @Override
    public HcpInterval getValue() {
        return HcpInterval.create(getValidMin(), getValidMax(), true);
    }
}

